
$(MAKECMDGOALS):boot.asm
        # 本来想支持clean，没折腾出来。不要用make clean，也不要用多个target
ifeq ($(MAKECMDGOALS),clean)
        rm -rf *.img *.bin
        exit "$$?";
        done
endif
	nasm -o boot.bin boot.asm
	nasm -o loader.bin $(MAKECMDGOALS).asm
	dd if=/dev/zero of=$(MAKECMDGOALS).img bs=1474560 count=1
	dd if=boot.bin of=$(MAKECMDGOALS).img bs=512 count=1 conv=notrunc
	sudo mount -o loop $(MAKECMDGOALS).img /mnt/floppy
	sudo cp loader.bin /mnt/floppy
	sudo umount /mnt/floppy
